import { defineStore } from 'pinia'

export const useUserStore = defineStore('user', {
  state: () => {
    return {
      // @ts-ignore
      userinfo: JSON.parse(sessionStorage.getItem('userinfo') || null) || {}
    }
  },
  actions:  {
    changeUserinfo(info) {
      this.userinfo = info;
    }
  }
})
